<html>
<head><meta charset="utf-8"><title>miri speed · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/miri.20speed.html">miri speed</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="166953277"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/miri%20speed/near/166953277" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/miri.20speed.html#166953277">(May 30 2019 at 23:05)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> <span class="user-mention" data-user-id="120791">@RalfJ</span> is there a rough estimate of miri's slowdown factor that I can use as a rule of thumb?</p>



<a name="166975696"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/miri%20speed/near/166975696" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/miri.20speed.html#166975696">(May 31 2019 at 07:45)</a>:</h4>
<p>other than "a lot"?^^<br>
in <a href="https://github.com/rust-lang/miri/issues/638" target="_blank" title="https://github.com/rust-lang/miri/issues/638">https://github.com/rust-lang/miri/issues/638</a> someone reported "100x slower than python". I didn't verify that.</p>



<a name="166990762"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/miri%20speed/near/166990762" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/miri.20speed.html#166990762">(May 31 2019 at 12:01)</a>:</h4>
<p>I once benchmarked against plain execution, and I think these benchmarks are even still around in our repo, so you can test how bad it is today, but it used to be quite a few orders of magnitude</p>



<a name="166990768"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/miri%20speed/near/166990768" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/miri.20speed.html#166990768">(May 31 2019 at 12:01)</a>:</h4>
<p>with stacked borrows that probably got even worse :D</p>



<a name="166992621"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/miri%20speed/near/166992621" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/miri.20speed.html#166992621">(May 31 2019 at 12:33)</a>:</h4>
<p>I hold out hope of running Miri on a testsuite driven by a property-based test suite</p>



<a name="166993393"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/miri%20speed/near/166993393" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/miri.20speed.html#166993393">(May 31 2019 at 12:45)</a>:</h4>
<p>have you tried running miri on a quickcheck test suite?</p>



<a name="166993405"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/miri%20speed/near/166993405" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/miri.20speed.html#166993405">(May 31 2019 at 12:45)</a>:</h4>
<p>we do have random number generators nowadays</p>



<a name="166998007"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/miri%20speed/near/166998007" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/miri.20speed.html#166998007">(May 31 2019 at 13:44)</a>:</h4>
<p>to give you an idea: the libcore test suite takes 0.4s when running "for real" and 6:20 min when running in Miri</p>



<a name="166998076"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/miri%20speed/near/166998076" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/miri.20speed.html#166998076">(May 31 2019 at 13:45)</a>:</h4>
<p>that's roughly 1000x slowdown</p>



<a name="166998089"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/miri%20speed/near/166998089" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/miri.20speed.html#166998089">(May 31 2019 at 13:45)</a>:</h4>
<p>which is in the same ballpark as "100x slower than python" I guess ;)</p>



<a name="166998166"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/miri%20speed/near/166998166" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/miri.20speed.html#166998166">(May 31 2019 at 13:46)</a>:</h4>
<p>uh, I wanted to test that with validation disabled but then in ICEs...^^</p>



<a name="167002079"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/miri%20speed/near/167002079" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/miri.20speed.html#167002079">(May 31 2019 at 14:35)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> quickcheck is old and busted. proptest is where it's at.</p>



<a name="167002135"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/miri%20speed/near/167002135" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/miri.20speed.html#167002135">(May 31 2019 at 14:36)</a>:</h4>
<p>What's annoying is that the places I want to use it are probably the most Miri-difficult: FFI and SIMD</p>



<a name="167002191"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/miri%20speed/near/167002191" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/miri.20speed.html#167002191">(May 31 2019 at 14:36)</a>:</h4>
<p>disabling validity is a roughly 2x speedup... as in, still 500x slower than "real"^^</p>



<a name="167002231"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/miri%20speed/near/167002231" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/miri.20speed.html#167002231">(May 31 2019 at 14:37)</a>:</h4>
<p>yeah, SIMD needs someone to implement 5k intrinsics and FFI... I doubt will ever happen^^</p>



<a name="167002616"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/miri%20speed/near/167002616" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/miri.20speed.html#167002616">(May 31 2019 at 14:41)</a>:</h4>
<p>For examples...</p>
<p>I have twox-hash which uses proptest to validate the pure-Rust output against the C implementation. That's an "easy" property. Coming up with self contained properties is much harder.</p>
<p>I also have jetscii, which uses proptest to validate the SIMD output against the non-SIMD output.</p>



<a name="167002628"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/miri%20speed/near/167002628" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/miri.20speed.html#167002628">(May 31 2019 at 14:41)</a>:</h4>
<p>In the first case, I don't want to run Miri on the FFI code.</p>



<a name="167002720"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/miri%20speed/near/167002720" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/miri.20speed.html#167002720">(May 31 2019 at 14:42)</a>:</h4>
<p>Is there a way to annotate a function to have Miri not inspect within it?</p>



<a name="167002793"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/miri%20speed/near/167002793" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/miri.20speed.html#167002793">(May 31 2019 at 14:43)</a>:</h4>
<p>"inspect within it"?</p>



<a name="167002797"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/miri%20speed/near/167002797" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/miri.20speed.html#167002797">(May 31 2019 at 14:43)</a>:</h4>
<p>miri doesnt inspect anything, it evaluates</p>



<a name="167002855"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/miri%20speed/near/167002855" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/miri.20speed.html#167002855">(May 31 2019 at 14:44)</a>:</h4>
<p>so it doesnt matter if there is FFI that is not used. but if your code <em>runs</em> FFI, there's nothing we can do.</p>



<a name="167002888"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/miri%20speed/near/167002888" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/miri.20speed.html#167002888">(May 31 2019 at 14:44)</a>:</h4>
<p>cant you do the comparison "externally"? like, have the evaluation in Miri dump the results to a file and then compare that</p>



<a name="167002893"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/miri%20speed/near/167002893" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/miri.20speed.html#167002893">(May 31 2019 at 14:44)</a>:</h4>
<p>that just requires disk I/O which is much more realistic than FFI ;)</p>



<a name="167002921"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/miri%20speed/near/167002921" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/miri.20speed.html#167002921">(May 31 2019 at 14:45)</a>:</h4>
<p>I'm trying to think what the speed tradeoff would be there</p>



<a name="167002947"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/miri%20speed/near/167002947" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/miri.20speed.html#167002947">(May 31 2019 at 14:45)</a>:</h4>
<p>Can I call <code>std::cmd::Process</code> under Miri?</p>



<a name="167003028"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/miri%20speed/near/167003028" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/miri.20speed.html#167003028">(May 31 2019 at 14:46)</a>:</h4>
<p>then I could run the FFI in another non-Miri process.</p>



<a name="167003092"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/miri%20speed/near/167003092" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/miri.20speed.html#167003092">(May 31 2019 at 14:47)</a>:</h4>
<p>Realistically, I can just run the tests 2x: once with comparing against FFI and once with the comparison replaced by <code>true</code>. Find bugs in the first run, UB in the second.</p>



<a name="167003198"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/miri%20speed/near/167003198" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/miri.20speed.html#167003198">(May 31 2019 at 14:48)</a>:</h4>
<p>no. but that is possible in principle...</p>



<a name="167003199"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/miri%20speed/near/167003199" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/miri.20speed.html#167003199">(May 31 2019 at 14:48)</a>:</h4>
<p>lots of work but not impossible</p>



<a name="167003200"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/miri%20speed/near/167003200" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/miri.20speed.html#167003200">(May 31 2019 at 14:48)</a>:</h4>
<p>someone would have to add a shim for <code>popen</code> I guess</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>